Lightfield rendering is an alternative to model-based rendering of a scene. In model-based rendering, a three-dimensional (3-D) model of a scene is constructed, e.g., using polygons such as triangles to construct models that represent objects in the scene. Frames are rendered from the point of view of a “camera” by calculating the intensity of light that enters the camera after being reflected, refracted, or radiated by portions of the models. In contrast, lightfield rendering is used to render frames based on a four-dimensional (4-D) function that can be formed of two-dimensional (2-D) images of a portion of a scene. The images represent views of the portions of the scene from different perspectives and frames are rendered from the point of view of the camera by sampling portions of the 2-D images. For example, the coordinates (u, v, s, t) in the 4-D function that represents the lightfield can be defined so that (u, v) determine one of the camera images in the lightfield and (s, t) are coordinates of pixels within the camera image. Other definitions of the four coordinates of the 4-D function that represents the lightfield can also be used. One example of a lightfield rendering technique is disclosed in Levoy and Hanrahan, Lightfield Rendering, Proc. ACM SIGGRAPH, 1996, which is incorporated herein by reference in its entirety.
Lightfield rendering may require less processing power than model-based rendering in some cases, but lightfield rendering requires significantly more memory to store the camera images that represent the lightfield. Transmission of uncompressed datasets of the size typically required for lightfields is impractical in current systems. Furthermore, uncompressed lightfield datasets are too large to fit in the memory of almost all real world rendering systems, such as smart phones, tablet computers, or standalone virtual reality head mounted devices (HMDs), which means rendering images from an uncompressed lightfield datasets is impractical. Lightfield datasets therefore generally are compressed for storage and transmission, particularly if the dataset is to be used by devices with fewer storage resources.
Block-based data compression can be used to compress lightfield datasets that are used to render frames in a graphics processing system. For example, a discrete cosine transform (DCT) can be applied to pixels in a 2-D block of pixels to generate frequency components that represent the values of the pixels in the block. Adjacent pixels in images are typically highly correlated and the correlations can be used to predict the value of a pixel from values of neighbor pixels. The DCT transform exploits the interpixel correlation in natural images to reduce information entropy, e.g., by representing the highly correlated spatial pixel data as uncorrelated DCT coefficients. In order to achieve the desired compression ratios for lightfield datasets, variable length codes are used to quantize the DCT coefficients. In addition, the human eye is less sensitive to the higher frequency components, which can therefore be discarded or stored at a lower accuracy than the lower frequency components, thereby further compressing the block. Additional lossless compression, such as Huffman encoding or other entropy coding techniques, can be applied to further compress the information representative of a portion of the image associated with the block. Compressing a digital image (and decompressing the compressed image) according to DCT schemes that utilize variable length codes for quantization does not support random access on a pixel-by-pixel basis because compressing blocks using DCT coefficients that are encoded with variable length codes results in the compressed blocks being stored at unpredictable memory locations.